using System.Collections.Generic;
using UnityEngine;

public class ButtonInsetController : MonoBehaviour
{
	private List<ButtonInset> buttons = new List<ButtonInset>();

	private ButtonInset lastOpen;

	[SerializeField]
	private GameObject typeButton;

	public static ButtonInsetController instance;

	public List<GameObject> gameTypeWindow = new List<GameObject>();

	private void Awake()
	{
		instance = this;
		buttons.AddRange(GetComponentsInChildren<ButtonInset>());
	}

	private void Start()
	{
		OpenInset(buttons[0]);
	}

	private void OnDestroy()
	{
		instance = null;
	}

	public void OpenInset(ButtonInset button)
	{
		foreach (ButtonInset button2 in buttons)
		{
			if (button == button2)
			{
				button2.ActivateInset(true);
			}
			else
			{
				button2.ActivateInset(false);
			}
		}
	}
}
